package pers.corvey.studyjava.model.json;

import java.util.ArrayList;
import java.util.List;

import pers.corvey.studyjava.model.QuestionAnswer;
import pers.corvey.studyjava.util.ToStringUtils;

public class QuestionAnswerJson {
    
    private String questionId;
    private List<String> choiceIds = new ArrayList<>();

    public QuestionAnswerJson() {}
    
    public String getQuestionId() {
        return questionId;
    }

    public void setQuestionId(String questionId) {
        this.questionId = questionId;
    }

    public List<String> getChoiceIds() {
        return choiceIds;
    }

    public void setChoiceIds(Iterable<QuestionAnswer> questionAnswers) {
        for (QuestionAnswer questionAnswer : questionAnswers) {
            choiceIds.add(questionAnswer.getChoiceId());
        }
    }
    
    @Override
    public String toString() {
        return ToStringUtils.objectToString(this);
    }
}
